#ifndef RTSPWIDGET_H
#define RTSPWIDGET_H

#include "public/VideoBase.h"

#include "rtspthread.h"

#include <QOpenGLFunctions>
#include <QOpenGLWidget>

#include <models/robot.h>


class RtspWidget : public VideoBase
{
    Q_OBJECT
public:
    RtspWidget(QWidget *parent = nullptr);
    virtual ~RtspWidget();
    void setUrl(QString strUrl);
    void setShowMax(bool newShowMax);

    // VideoBase interface
protected:
    void startPlay();
    void stopVideo(bool bSync);
    void takePhoto();
    bool startRecording();
    bool stopRecording(bool bSync);
    void setMute(bool bMute);
    void paintEvent(QPaintEvent *event);
    void resizeEvent(QResizeEvent *event);
    QString getDestType(int destType);
public slots:
    void onSentryIndifyChanged(float fieldangle,float undershootX, float undershootY,QVector<SentryDestInfo> vtDest);
    void onSentryDistanceChanged(int destType,int destNum, float distance);
private:
    bool m_bRun;
    bool m_bMute;
    RtspThread m_rtspThread;
    QImage m_frame;
    bool m_bPlaySucc;
    QMutex m_lockFrame;


    //哨兵头控制控件
    QWidget * m_pSentryWidget;
    TouchButton * m_pIdentifyBtn; //识别
    TouchButton * m_pTrackBtn; //跟踪
    TouchButton * m_pGetRetBtn; //获取识别跟踪结果
    bool m_bGetRet;
    TouchButton * m_pLaserBtn; //测距
    bool m_bGetLaser;
    QLabel * m_pSoundLab;//主麦阵角度包

};

#endif // RTSPWIDGET_H
